/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.view.relations;

import org.jfonia.connect5.basics.MutableValueNode;
import org.jfonia.connect5.basics.ValueNode;
import org.jfonia.connect5.relations.ABCRelation;

/**
 *
 * @author Rik Bauwens
 */
public class RoundMultiplicationRelation extends ABCRelation<Double, Integer, Double>
{
        public RoundMultiplicationRelation(ValueNode<Double> a, MutableValueNode<Integer> b, MutableValueNode<Double> c)
        {
                super(a, b, c);
        }

        public void updateB()
        {
                b.setValue(new Double(c.getValue() / a.getValue()).intValue(), this);
        }

        public void updateC()
        {
                c.setValue(a.getValue() * (double) b.getValue(), this);
        }
}